<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    {{ a.school }}
  {{ a.school2 }}
</div>

</body>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    //1.使用变量时需要初始化，否则新加的属性不会导致页面刷新
   let vm =  new Vue({
        el: '#app',
            data:{
               a:{school:""}
            }
    })
    //2.此方法可以给对象添加响应式的方法,命令行输入vm.a.school2="aaaa"，就可以出现了
    vm.$set(vm.a,'school2');

   //3.替换原对象
   vm.a = {school:'akfdfd',age:8,adress:'fdsfd'}

</script>
</html>
